package router

import (
	"github.com/gin-gonic/gin"
	"lab.com/controller"
)

// 新闻公告的接口
func initNewsRouter(e *gin.Engine) {

	newsControl := controller.News
	newsRouter := e.Group("/news")

	// 所有用户可查看，展示在官网首页上面
	newsRouter.GET("list", newsControl.List)
	newsRouter.GET("detail", newsControl.Detail)

	// 管理员，对新闻公告进行管理
	newsRouter.POST("manage/add", newsControl.Add)
	newsRouter.GET("manage/delete", newsControl.Delete)
	newsRouter.POST("manage/edit", newsControl.Edit)
	newsRouter.GET("manage/show", newsControl.Show)
	newsRouter.GET("manage/home", newsControl.Home)
	newsRouter.GET("manage/list", newsControl.ListInManage)
}
